package com.fcl.mylibrary.ui;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.fcl.mylibrary.reflect.ViewInjectUtils;

/**
 * Created by Administrator on 2017/3/15.
 */

public abstract class BaseFragment extends Fragment {

    protected View mRootView;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        mRootView = inflater.inflate(getLayoutId(), container, false);
        ViewInjectUtils.inject(this, mRootView);
        init();
        return mRootView;
    }

    protected void init() {}

    protected abstract int getLayoutId();
}
